//
//  EditRenGouCell.m
//  LuCaiZhu
//
//  Created by stella Ma on 2018/12/20.
//
#import "NSString+NN.h"
#import "EditRenGouCell.h"

@implementation EditRenGouCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self.mTextField addTarget:self action:@selector(textFieldDidEnd:) forControlEvents:UIControlEventEditingDidEnd];
//    [self.mTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
}

- (void)textFieldDidEnd:(UITextField *)textfield {
    textfield.text = [textfield.text trimmingCharacters];
//    NSString *moneySt = textfield.text;
//    if ([moneySt rangeOfString:@","].length>0) {
//        NSArray *aa = [moneySt componentsSeparatedByString:@","];
//        moneySt = [aa componentsJoinedByString:@""];
//    }
    if (self.returnBlock) {
        self.returnBlock(textfield.text);
    }
}

- (void)textFieldDidChange:(UITextField *)textfield {
//    NSString *moneySt = textfield.text;
//    if ([moneySt rangeOfString:@","].length>0) {
//        NSArray *aa = [moneySt componentsSeparatedByString:@","];
//        textfield.text = [aa componentsJoinedByString:@""];
//    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
